<?php
    require_ONCE("global.php");
    require_ONCE("HttpApi.php");
    
    $userid = $_GET["ownerid"];
    $parentid = $_GET["parentid"];
    $name = $_GET["name"];
    
    $ownerid = $userid;
    $dirid = $parentid;
    $url = 'http://'.$DS_HOST.'/'.$userid.'/'.$parentid.'/fileversion?name='.$name;
    
    //echo $url;
    $http = new HttpApi();
    $params = Array(
                    //"name" => $name,
                    );
    
    $result = json_decode($http->makeRequest($url, $params));
    //print_r($result);
    $data = get_object_vars($result);
    
    // groups
    $sql = "select u.username, u.userid from users as u join group_rel g on u.userid = g.groupid where g.userid = $userid;";
    $groups = $db->fetchAll($sql);
    
    $isversion = 1;
    include("templates/main.html");
?>
